<template>
	<view>
		<view class="zhanginfo">
			账号信息
		</view>
		<view class="zuxiao" @click="zuxiao">
			<view class="left-ts">
				注销账号
			</view>
			<image src="/static/yjt.png" style="width: 40rpx;height: 40rpx;" mode=""></image>
		</view>
		<view class="guan">
			关于
		</view>

		<view class="fuwuinfo">
			<view class="yhinfo" @click="tofuw">
				<view class="l-txt">
					用户服务协议
				</view>
				<image src="/static/yjt.png" style="width: 40rpx;height: 40rpx;" mode=""></image>
			</view>
			<view class="ysinfo" @click="toyins">
				<view class="l-txt" >
					隐私政策
				</view>
				<image src="/static/yjt.png" style="width: 40rpx;height: 40rpx;" mode=""></image>
			</view>
		</view>

		<view class="tuichu"  @click="exitBut()">
			<view class="tc-txt">
				退出登录
			</view>
		</view>
	</view>
</template>

<script>
	import ikz from '@/pages/Common/tools.js';
	export default {
		data( ) {
			return {

			};
		},
		methods: {
			zuxiao( ) {
				var _this = this
				uni.showModal( {
					title: '提示',
					content: '账号注销后所有数据将被清楚，请认真考虑',
					cancelColor:'#666666',
					confirmText:'确定注销',
					confirmColor:'#FF3500',
					success: function( res ) {
						if ( res.confirm ) {
							console.log( '用户点击确定' );
							
						} else if ( res.cancel ) {
							console.log( '用户点击取消' );
						}
					}
				} );
			},
			tofuw(){
				uni.navigateTo({
					url:'/pages/Component/Module/Other/Program/agreement/index'
				})
			},
			toyins(){
				uni.navigateTo({
					url:'/pages/Component/Module/Other/Program/insiinfo/insiinfo'
				})
			},
			// 退出登录
			exitBut( ) {
				uni.showModal( {
					title: "系统提示",
					content: "确定要退出登录吗？",
					confirmColor: "#F8C66D",
					success: ( res ) => {
						if ( res.confirm ) {
							var path = '/user/logout';
							var data = {}
							ikz.post( path, data, res => {
								if ( res.data.code ) {
									uni.removeStorageSync( "local_user_session" )
									uni.removeStorageSync( "user_info" )
									uni.reLaunch( {
										url: "/pages/Personal/index"
									} )
								} else {
									uni.showModal( {
										title: '提示',
										content: res.data.msg,
										showCancel: false,
										success: function( res ) {}
									} );
								}
							} );
			
						}
					}
				} )
			},
		},
	}
</script>

<style lang="scss">
	page {
		background-color: #F5F5F5;
		padding: 22rpx 30rpx;
		box-sizing: border-box;
	}

	.zhanginfo {
		width: 100%;
		height: 36rpx;
		font-weight: 400;
		font-size: 24rpx;
		color: #000000;
		text-align: left;
		margin-bottom: 12rpx;
	}

	.zuxiao {
		width: 690rpx;
		height: 104rpx;
		background: #FFFFFF;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		padding: 0 16rpx;
		box-sizing: border-box;
		display: flex;
		align-items: center;
		justify-content: space-between;

		.left-ts {
			width: 50%;
			height: 40rpx;
			font-weight: 500;
			font-size: 28rpx;
			color: #222222;
			text-align: left;
		}
	}

	.guan {
		width: 100%;
		height: 36rpx;
		font-weight: 400;
		font-size: 24rpx;
		color: #000000;
		text-align: left;
		margin-top: 48rpx;
	}

	.fuwuinfo {
		width: 690rpx;
		height: 210rpx;
		background: #FFFFFF;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		padding: 0 16rpx;
		box-sizing: border-box;
		margin-top: 12rpx;

		.yhinfo {
			width: 100%;
			height: 104rpx;
			border-bottom: 1rpx solid #F8F8F8;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.l-txt {
				width: 168rpx;
				height: 40rpx;
				font-weight: 500;
				font-size: 28rpx;
				color: #222222;
				text-align: left;
				line-height: 40rpx;
			}
		}

		.ysinfo {
			width: 100%;
			height: 104rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.l-txt {
				width: 168rpx;
				height: 40rpx;
				font-weight: 500;
				font-size: 28rpx;
				color: #222222;
				text-align: left;
				line-height: 40rpx;
			}
		}
	}

	.tuichu {
		width: 690rpx;
		height: 104rpx;
		background: #FFFFFF;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		padding: 32rpx 16rpx;
		box-sizing: border-box;
		margin-top: 48rpx;
	}
</style>